test(checkpoint): expand parity metrics and phase coverage - #3567
Conversation
6e4df85 to
7b0f1bb
Compare
|
/ok to test dea894a |
|
/ok to test 10812cb |
|
/ok to test 7cb1978 |
Signed-off-by: Yuhe Zhang <yuhez@nvidia.com>
…rics' into yuhez/test/checkpoint-parity-metrics Signed-off-by: Yuhe Zhang <yuhez@nvidia.com>
|
/ok to test 4611e89 |
Signed-off-by: Yuhe Zhang <yuhez@nvidia.com>
|
/ok to test f5e6870 |
|
/ok to test 92bdc0b |
Resolve the PEFT target-module mapping conflict by keeping main's canonical hook and porting the Nemotron namespace mapping to it. Signed-off-by: Yuhe Zhang <yuhez@nvidia.com>
|
/ok to test 2050b32 |
| parity_tolerance_profile: relaxed | ||
| parity_threshold_overrides: | ||
| automodel_reload: | ||
| mean_kl: 4e-2 |
There was a problem hiding this comment.
[P2] Step override is parsed as a string
Findings: 4e-2 round-trips through ruamel unchanged. PyYAML then loads it as a string. The checkpoint harness rejects the value before any robustness phase starts. The example at tests/ci_tests/README.md:212 reproduces the issue.
Proposal: Write 0.04 in both locations. Add a resolver test that reloads output with PyYAML.
There was a problem hiding this comment.
Good catch — confirmed. I changed both occurrences to 0.04, and the calibration resolver test now reloads the generated YAML with PyYAML, matching the checkpoint harness consumer. The focused calibration cohort passes (19 passed). Fixed in 9cad931.
Signed-off-by: Yuhe Zhang <yuhez@nvidia.com>
thomasdhc
left a comment
There was a problem hiding this comment.
LGTM.
Review notes
- The StepFun threshold remains numeric through the resolver and PyYAML consumer boundary.
- The resolver test now exercises the same YAML loader used by the checkpoint harness.
|
/ok to test 9cad931 |
…-parity-metrics Signed-off-by: Yuhe Zhang <yuhez@nvidia.com> # Conflicts: # examples/vlm_finetune/gemma4/gemma4_26b_a4b_moe.yaml
|
/ok to test a6e84a2 |
What does this PR do?
Expand checkpoint-robustness coverage and replace per-model max-KL tuning with stable, profile-based full-logit metrics.
Changelog
strict,standard, andrelaxedprofiles. Keep one optional structuredparity_threshold_overridesmapping for measured exceptions acrosssource_load,automodel_reload,hf_reload, andcross_tp; omitted metrics inherit the selected profile. Step uses only its AutoModel-reload mean/cosine entries. Max KL remains diagnostic and is not overridable.hf_source_self_repeat/hf_export_self_repeat, so an unstable reference is distinguishable from cross-framework drift.skip_source_load_logit_parity,skip_automodel_reload_logit_parity,skip_hf_reload_logit_parity).trust_remote_code: falseoverride a recipe default oftrue.standardprofile and default-on HF reload/native-resume phases; structured cosine overrides remain available only if a measured exception appears.backbone.*or native Transformersmodel.*namespace.Phase contract
Config controls: Phase 0 —
skip_source_load_parity,skip_source_load_logit_parity; Phase 2 —skip_automodel_reload_logit_parity; Phase 3 —skip_hf_reload,skip_hf_reload_logit_parity; Phase 4 —skip_resume; Phase 5 —cross_tp_size.Phases 0-4 are the default core coverage. A phase is skipped only for a documented capability/reference limitation; an observed mismatch alone remains blocking.
Numerical profiles
strict1e-7/1e-6/0.9999991e-6/1e-5/0.999991e-4/1e-3/0.9999standard(default)3e-3/1.2e-2/0.9996e-3/3e-2/0.9986e-3/3e-2/0.998relaxed2e-2/5e-2/0.9952e-2/5e-2/0.9952.5e-2/1e-1/0.99The ordering is monotonic: changing topology is never stricter than the same implementation.
standardis the default for dense and stable-MoE paths, whilerelaxedis reserved for measured distributed or low-precision drift. Neither model size nor TP/PP alone justifies a looser profile. A measured exception usesparity_threshold_overridesfor only the exceeded gate(s), with every unspecified profile gate retained.Max KL remains diagnostic because sparse outliers can be large while distribution-level metrics remain stable; for example, Qwen3-MoE HF reload reached max KL
1.406with mean/p950.00228 / 0.00597and cosine0.99879.Scoped-CI calibration
Earlier 20-model calibration established the profile boundaries and kept unexplained correctness/load failures blocking. The rebased active-LLM repair cohort 63498589 then completed 23 jobs: 15 passed and 8 failed for classified reasons. Follow-up pipeline 63504152 passed all four GPT-OSS Customizer variants and both Nemotron Flash variants without skipping a phase or changing a profile definition; pipeline 63510378 passed the repaired Nano 4B PEFT export reload.
Final routed-MoE regression pipeline 63512263 ran eight exact jobs from SHA
f041b88e733f9d8162b3387348371d705304e7d5: all four GPT-OSS variants, Qwen3 MoE, Nemotron Nano Customizer full SFT, and Nano 4B PEFT passed. The Nemotron chat variant restored model/buffers/optimizer/scheduler/RNG exactly and passed steps 5-6, but its step-7 loss differed by0.021995(0.497%) versus the standard0.013853allowance. Its non-chat sibling passed standard with0.000277step-7 drift.The existing relaxed resume profile allows
0.043201for the measured chat loss, so final SHA10812cb4102322dac731c55e25142e80cfe75593selects it only for that routed hybrid-MoE chat config. Logit gates remain standard, no numeric override or skip was added, and the non-chat sibling remains standard. Exact one-job pipeline 63517674 passed all phases. Its step-7 drift was0.005666, smaller than the calibration run and well inside the shared profile; exact restored state passed again.Current decisions
standardrelaxed; resume re-enabledrelaxed; resume enabledrelaxed; failed — blockinglayer_typesload failure and 40 resume-buffer mismatches remain under AM-202.standard; resume re-enabledstandardlogits, relaxed resumestandardstandardlogits; chat-onlyrelaxedresumestandard; documented Mamba resume skipstandardstandard; no resume skipOutputRecorderimport failure is tracked by AMINT-288.standardstandardrelaxed+ Phase 2 mean0.04/ cosine0.99; only HF gates informationalstandardstandardstandardrelaxedFinal routed-MoE regression metrics
Each parity cell is
mean / p95 / max KL; cosine. Resume is the absolute loss difference at steps 5/6/7. The chat row records the calibration run; its independent final-SHA rerun passed with resume differences0.002103 / 0.000127 / 0.005666..007554/.028003/.554645; .9991440/0/0; 1.008223/.034005/.790934; .9991540/.002969/.002026.007554/.028003/.554645; .9991440/0/0; 1.005849/.016791/1.754057; .9994220/.004654/.002209.005401/.019350/.611482; .9994100/0/0; 1.007292/.021927/2.030980; .9991820/0/0.006386/.018244/.862887; .9992330/0/0; 1.006193/.022491/.814642; .9993560/0/0.002541/.010453/.239663; .999287.002245/.008229/.080814; .999355.002588/.009124/.249942; .999291.001315/.001557/.000277.002594/.010720/.232123; .999278.000576/.002029/.030139; .999849.002881/.011180/.305111; .999207.001347/.003246/.021995.002598/.009486/.271365; .9981720/0/0; 1.001871/.005224/.662879; .9990210/0/0.000459/.001849/.009560; .999925.000495/.001915/.010723; .999923.000500/.001897/.006943; .999922Outstanding model issues
OutputRecordercompatibility.main; fresh Phase 4 diagnostics are exact.layer_typesand 40 router-buffer mismatches.runningwhile Slurm accounting is temporarily unavailable, delaying propagation of terminal job state.Full 20-model metric table
Each comparison cell is
mean / p95 / max KL; c cosine; d mean / max absolute logit difference.0means bitwise-identical logits. Metrics are from pipeline 63229114 except the marked Step source/AM/resume values, which use the newer pipeline 63229651.0; c 1; d 0.002598/.009486/.2714; c .99817; d .1293/8.8050; c 1; d 00; c 1; d 0.001649/.005984/.03904; c .99905; d .08808/8.9060; state exact0; c 1; d 0.005637/.029114/.06446; c .99987; d .2813/16.50; c 1; d 00; c 1; d 0.005842/.028533/.08861; c .99986; d .2889/13.25not run; now enabled0; c 1; d 013.139/22.326/36.013; c .02378; d 4.132/41.50; c 1; d 00; c 1; d 06.248/11.409/18.178; c .01950; d 4.167/43.03.003000; state exact0; c 1; d 0.005909/.019362/1.368; c .99933; d .08169/14.0.006648/.022910/.8930; c .99930; d .08942/7.3980; c 1; d 0.007906/.021799/1.482; c .99910; d .09503/17.69not run; now enabled—; HF load failed—; HF load failed.005166/.021667/.3463; c .99816; d .2250/15.44——; HF load failed.00431; params/optimizer exact; 40 buffers differ0; c 1; d 0.002598/.009486/.2714; c .99817; d .1293/8.8050; c 1; d 00; c 1; d 0.002278/.005972/1.406; c .99879; d .08868/15.52not run; now enabled0; c 1; d 0.000861/.002358/.00789; c .99990; d .03762/.4375.001095/.003079/.00973; c .99987; d .04348/.5313—; unsupported HF reload—; unsupported HF reload.008243; state exact0; c 1; d 0.002570/.010360/.1663; c .99924; d .08407/6.236—; timeout—; timeout—; timeout—; timeout0; c 1; d 0.000542/.001872/.01721; c .99990; d .02540/.97660; c 1; d 00; c 1; d 0.000515/.001794/.01643; c .99990; d .02484/1.25.000627; state exact0; c 1; d 0.000584/.001993/.00969; c .99984; d .02947/1.531.000518/.001898/.01021; c .99984; d .02802/3.250; c 1; d 0.000565/.001947/.02115; c .99983; d .02932/1.844steps 5-6 exact; step 7 .001261; all restored/gradient/post-step digests exact—; remote import failed—; remote import failed.002363/.009074/.06528; c .99934; d .09521/8.652—; remote import failed—; remote import failed.000847; state exact0; c 1; d 0.004814/.016797/.5545; c .99944; d .08023/12.88—; timeout—; timeout—; timeout—; timeout0; c 1; d 0.2909/.6578/30.334; c .97475; d 4.668/2340; c 1; d 00; c 1; d 0.05680/.04250/18.737; c .99818; d 2.539/760; state exact0; c 1; d 0.000957/.003744/.07851; c .99967; d .05159/9.1560; c 1; d 00; c 1; d 0.000913/.003166/.1424; c .99976; d .04806/4.281.003327; state exact1.892/5.616/17.622; c .76583; d 1.407/21.46*2.599/13.498/39.303; c .80205; d 1.308/42.66*.004473/.012207/.9024; c .99579; d .1383/15.63*1.948/4.726/14.480; c .80724; d 1.188/26.63.7678/2.704/23.179; c .85263; d 1.109/32.81.006711; pre-state and first forward exact*.04461/.16181/5.390; c .98238; d .3101/14.31.000498/.001997/.01446; c .99922; d .03549/11.820; c 1; d 00; c 1; d 0.000472/.001946/.01296; c .99937; d .03363/11.05.000460; state exact0; c 1; d 0.002063/.007866/.09401; c .99854; d .08786/7.8910; c 1; d 0.05982/.23924/6.741; c .98483; d .3052/12.16.001870/.007141/.1011; c .99832; d .08810/10.66.000761; state exact0; c 1; d 0.002077/.007950/.2456; c .99870; d .1019/9.633.001397/.004856/.1208; c .99928; d .06816/6.1880; c 1; d 0.001393/.004739/.1531; c .99919; d .07135/8.188.000554; state exact0; c 1; d 0.003163/.011946/.6453; c .99851; d .1272/11.0.001104/.004206/.03141; c .99943; d .07178/13.310; c 1; d 0.02053/.08288/1.519; c .99223; d .3168/15.15.000414; state exact11.133/19.072/27.995; c .46537; d 5.931/43.1311.846/19.370/28.673; c .45972; d 5.936/44.630; c 1; d 0.5665/2.322/10.673; c .86457; d 2.477/27.94.07024/.29182/5.345; c .98810; d .6554/22.170; state exactStep3.7 and Gemma4 HF-reference evidence
1.892 / 5.616 / 17.6220.765831.407 / 21.462.599 / 13.498 / 39.3030.802051.308 / 42.660.004473 / 0.012207 / 0.90240.995790.1383 / 15.631.948 / 4.726 / 14.4800.807241.188 / 26.6311.133 / 19.072 / 27.9950.465375.931 / 43.1311.846 / 19.370 / 28.6730.459725.936 / 44.630100.5665 / 2.322 / 10.6730.864572.477 / 27.94Stable Qwen/ERNIE MoE controls show that MoE/EP/PP alone does not justify a relaxed or skipped gate. Therefore only Step/Gemma's HF-based numerical gates are informational. Their AutoModel reload and native-resume checks remain active. Nemotron Flash's HF export reload is now enabled and passes after applying the same pre-v5 remote-code compatibility setup used for source load.
Validation
ruff format --check,ruff check, andgit diff --checkpass.Additional information
maindirectly and includes the latestmainupdates through a normal merge commit.